﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using RESTServices.Dominio;
using RESTServices.Persistencia;

namespace RESTServices
{
     public class Salas : ISalas
    {
         public SalaDAO dao = new SalaDAO();
         public Sala CrearSala(Sala SalaAcrear)
        {
            return dao.Crear(SalaAcrear);
        }

         public Sala ObtenerSala(string codigo)
        {
            return dao.Obtener(int.Parse(codigo));
        }

         public Sala ModificarSala(Sala salaAModificar)
        {
            return dao.Modificar(salaAModificar);
        }

        public void EliminarSala(string codigo)
        {
            dao.Eliminar(ObtenerSala(codigo));
        }

        public List<Sala> ListarSalas()
        {
            return dao.ListarTodos().ToList();
        }
    }
}
